<?php	 

class Index extends Action{	

private $table='demo';
/*
+----------首页--------------------------------------------------------------------
*/
	public function main(){
  //phpinfo();
		$totalNum=$this->C()->countRecords($this->table,"select count(*) from TB");
		$page = _class('Page',array('totalRecords'=>$totalNum));
		$list=$this->C()->findAll($this->table,"select * from TB order by id desc limit $page->pageLimit");
		$this->assign(array('aticleList'=>$list,'page'=>$page));
		if(_isAjax()){//若使用了ajax分页，判断是否为JAAX提交
			$this->show('tpl_article/articleList'); 
		}else{
			$this->show('main'); 
		}
	}


/*  +------------------------------------------------------------------------------ */		
}
?>